<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue3基础语法</title>
</head>
<body>
<div id="app">
    <h3>Vue3.0 指令</h3>
    <p>v-bind指令</p>
    <a v-bind:href="url">广州市工贸技师学院官网</a>
    <h3>v-if指令</h3>
    <p v-if="visible">内容可见</p>
    <p v-else>内容不可见</p>
    <h4>v-for指令</h4>
    <ul>
        <li v-for="(item, key, index) in list" v-bind:key="item.id">
<!--            {{item.id}} --- {{item.name}} --- {{item.age}}-->
            {{key}} --- {{index}} --- {{item}}
        </li>
    </ul>
</div>
</body>
<script src="../libs/vue.global.min.js"></script>
<script>
    const app = Vue.createApp({
        data() {
            return {
                url: "https://www.gzittc.edu.cn",
                visible: false,
                list: [
                    {
                        id: 1,
                        name: "张三",
                        age: 18
                    },
                    {
                        id: 2,
                        name: "李四",
                        age: 19
                    },
                    {
                        id: 3,
                        name: "王五",
                        age: 20
                    }
                ]
            }
        }
    })
    app.mount("#app")
</script>
</html>